<%@ page language="java" session="true" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<jsp:include page="../common/framework/header.jsp" />
<link href="${pageContext.request.contextPath}/static/plugin/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/static/plugin/daterangepicker/daterangepicker.min.css" rel="stylesheet">
<style type="text/css">
	select.form-control {
	    height: 32px;
	    padding: 4px 6px;
	    width: 150px!important;
	}
	.bs-bars{padding:0;}
</style>
	<div id="container"
		class="effect aside-float aside-bright mainnav-lg navbar-fixed mainnav-fixed aside-fixed">

		<jsp:include page="../common/framework/topper.jsp" />
		<div class="boxed">
			<%--=======================  页面主体内容  ============================--%>
			<div id="content-container">
				<div class="wrappers">
					<%--=========================  页面标题  ==========================--%>
					<div id="page-title">
						<p class="page-header text-overflow table-header">
							执行报告&nbsp;&nbsp;<small>本页面为套件每次执行结果分析。详细说明请参考
							<a href="http://confluence.paas.sinopec.com/pages/viewpage.action?pageId=11343322#id-使用手册-_Toc471811866" target="_blank">&lt;使用手册&gt;</a></small>
						</p>
					</div>
					<ol class="breadcrumb">
						<li><a href="#">测试套件</a></li>
						<li class="active">执行报告</li>
					</ol>
					<div id="page-content">
						<div class="panel">
							<div class="panel-body pad-top-no">
								<div id="toolbar">
									<form id="search_form" class="form-inline" autocomplete="off">
<!-- 										<label class="control-label width-auto" for="appName">项目名称:</label> -->
<!-- 										<div class="input-group"> -->
<!-- 											<input id="appName" name="appName" type="text" placeholder="请输入" class="form-control"> -->
<!-- 										  	<span class="input-group-btn" onclick="searchForm();"> -->
<!-- 												<a class="btn btn-icon btn-hover-primary" type="button" style="margin-right: 15px;"> -->
<!-- 													<i class="fa fa-search" ></i> -->
<!-- 												</a> -->
<!-- 											</span> -->
<!-- 										</div> -->

										<label class="control-label width-auto" for="appName">套件名称:</label>
										<div class="input-group">
											<input id="appName" name="appName" type="text" placeholder="请输入" class="form-control" style="width: 130px; margin-right: 0;">
										  	<span class="input-group-btn" onclick="searchForm();">
												<a class="btn btn-icon btn-hover-primary" type="button" style="margin-right: 15px;">
													<i class="fa fa-search" ></i>
												</a>
											</span>
										</div>

										<label class="control-label width-auto" for="appGroup">文件大小:</label>
										<select class="form-control" id="appGroup" name="appGroup">
											<option value="">请选择分组</option>

												<option value="edas">edas</option>

												<option value="xyt">xyt</option>

										</select>

										<label class="control-label width-auto" for="appGroup">执行结果:</label>
										<select class="form-control" id="appGroup" name="appGroup">
											<option value="">请选择分组</option>

												<option value="edas">edas</option>

												<option value="xyt">xyt</option>

										</select>

										<label class="control-label width-auto" >时间范围:</label>
										<div class="input-group" style="margin-right: 15px;">
												<input id="daterangepicker" name="date-range-picker"
													   class="form-control text-center" style="width: 250px;margin-right: 0;">
												<div class="input-group-addon">
													<i class="fa fa-calendar"></i>
												</div>
											</div>

										<a id = "reset" class = "btn btn-gray" style="margin-top: 2px;"><i class="glyphicon glyphicon-share-alt"></i>重置</a>

									</form>
								</div>
                                  <table id="sysNumber" class="table" data-single-select="true" data-toolbar="#toolbar"
               						 data-buttons-class="hover-primary">
                                      <thead>
								        <tr>
								            <th data-field="state" data-checkbox="true"></th>
								            <th data-field="projectName">项目名称</th>
								            <th data-field="suiteName" >套件名称</th>
								            <th data-field="executeNumber" >执行次数</th>
								            <th data-field="executeState" >执行结果</th>
								            <th data-field="resultSize" >目录文件大小</th>
								            <th data-field="executeEndTime" >完成时间</th>
								            <th data-field="execUserName" >执行人</th>
								            <th data-align="center" data-width="140" data-formatter="pref_btns">操作</th>
								        </tr>
								    </thead>
                                  </table>
							</div>
						</div>

			</div>
		</div>
	</div>

		<%--=========================  过程可视化消息栏  ==========================--%>
		<jsp:include page="../common/framework/aside.jsp" />

		<%--=========================  左侧菜单  ==========================--%>
		<jsp:include page="../common/framework/lefter.jsp" />

	</div>

	<%--=========================  页面底部版权信息  ==========================--%>
	<jsp:include page="../common/framework/footer.jsp" />
	<%--=========================  选择皮肤功能  ==========================--%>
	<jsp:include page="../common/framework/page-set.jsp" />
</div>
	<div id="floating-top-right" class="floating-container"></div>
<%--===================================================--%>
<%-- END OF CONTAINER --%>

<jsp:include page="../common/framework/script.jsp" />
	<script src="${pageContext.request.contextPath}/static/js/common/bootdatatable.init.js"></script>
	<script src="${pageContext.request.contextPath}/static/plugin/bootstrap-table/bootstrap-table.min.js"></script>
	<script src="${pageContext.request.contextPath}/static/plugin/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
	<script src="${pageContext.request.contextPath}/static/plugin/moment-develop/moment.min.js"></script>
	<script src="${pageContext.request.contextPath}/static/plugin/moment-develop/local-zh-cn.js"></script>
	<script src="${pageContext.request.contextPath}/static/plugin/daterangepicker/daterangepicker.js"></script>


	<script type="text/javascript">
	//时间选择框
	$('#daterangepicker').daterangepicker({
	    autoApply: true,
			showDropdowns: true,
			timePicker: true,
			timePickerIncrement: 5,
			timePicker24Hour: true,
	    //minDate:moment().subtract(15, 'days'),
	    maxDate: new Date(),
//	     minDate: moment().subtract(1, 'months'),
//	     endDate: new Date(),
	    opens: "left",
			/* dateLimit: {
			 "days": 15
			 }, */
	    alwaysShowCalendars: true,
	    ranges: {
	        "今天": [moment().format('YYYY-MM-DD 00:00'),moment().format('YYYY-MM-DD HH:mm')]
	        ,"昨天": [moment().subtract(1, 'days').format('YYYY-MM-DD 00:00'),moment().subtract(1, 'days').format('YYYY-MM-DD 23:59')]
	        ,"最近7天": [moment().subtract(7, 'days').format('YYYY-MM-DD 00:00'),moment().format('YYYY-MM-DD HH:mm')]
	        ,"最近15天": [moment().subtract(15, 'days').format('YYYY-MM-DD 00:00'),moment().format('YYYY-MM-DD HH:mm')]
	        ,"本月": [moment().format('YYYY-MM-01 HH:mm'),moment().format('YYYY-MM-DD HH:mm')]
	        //,"本季度": [moment().startOf('quarter').format('YYYY-MM-DD'),moment().endOf('quarter').format('YYYY-MM-DD')]
	    },
	    locale: {
	        format: 'YYYY-MM-DD HH:mm',
	        separator:" ~ ",
	        applyLabel: '确定',
	        cancelLabel: '取消',
	        customRangeLabel: "自定义日期",
	        daysOfWeek: ["日", "一", "二", "三", "四", "五", "六"],
	        monthNames:["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"]
	    }
	},function (start, end, label) {
	    //选择时间之后操作
		startTime = start.format('YYYY-MM-DD HH:mm');
	    endTime = end.format('YYYY-MM-DD HH:mm');
	});

$(function() {
	//加载表格
	$('#sysNumber').bootdatagrid(
			"${pageContext.request.contextPath}/static/plugin/bootstrap-table/staticData/testReport.json", {
				pagination : true,
				pageNumber : 1,
				pageSize : 10,
				dataType:'json',
				singleSelect : false,
				striped : true,
				clickToSelect : true
	});

})
function invoiceFormatter(value,row,index){
	return 'ID '+value;
}
function pref_btns(value,row,index){
	var btns = '';
	btns += '<a class="btn-table-cell" onclick="tablebtnclick(this);">结果</a>';
	btns += ' | <a class="btn-table-cell" data-toggle="tooltip" data-container="body" data-placement="top" title="日志日志">详细内容</a>';
	btns += ' | <a class="btn-table-cell" onclick="tablebtnclick(this);">删除</a>';
	return btns;
}

function tablebtnclick(e){
	Alert.success($(e).text());
}
</script>
</body>
</html>

